﻿@model Tasks.UI.Models.SceneryModels.SceneryLibraryEditModel
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>景点编辑</title>
    <link href="@Config.GetCssResourcePath("main.css")" rel="stylesheet" type="text/css" />
    <link href="@Config.GetCssResourcePath("table.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="/Scripts/ckeditor/ckeditor_basic.js" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/global.js")" type="text/javascript"></script>
    <script type="text/javascript">

        //init
        $(function () {

            initProvince("#ProvinceID");
            initCity("#CityID");

            var ckConfig = {
                filebrowserImageUploadUrl: '/SystemSetting/CKEditorUploadImage',
                skin: 'office2003',
                toolbar: 'Basic'
            };


            var ckConfig2 = {
                filebrowserImageUploadUrl: '/SystemSetting/CKEditorUploadImage',
                skin: 'office2003',
                toolbar: 'Full'
            };

            ckConfig2.toolbar = [
    { name: 'document', items: ['Source', '-', 'Preview'] },
    { name: 'clipboard', items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'] },
    { name: 'editing', items: ['Find', 'Replace', '-', 'SelectAll', '-', 'SpellChecker', 'Scayt'] },
         { name: 'insert', items: ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe'] },

     '/',
     { name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'] },
     { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl'] },
     { name: 'links', items: ['Link', 'Unlink', 'Anchor'] },
      '/',
      { name: 'styles', items: ['Styles', 'Format', 'Font', 'FontSize'] },
      { name: 'colors', items: ['TextColor', 'BGColor'] },
      { name: 'tools', items: ['Maximize', 'ShowBlocks', '-', 'About'] }
      ];

            CKEDITOR.replace('Intro', ckConfig2);

            for (var i = 0; i < $(".InfoContents").length; i++) {
                CKEDITOR.replace('InfoContents' + i, ckConfig);
            }

            $("#tabs").tabs();

            //验证设置
            $("form").eq(0).validate({
                rules: {
                    SceneryName: "required"
                },
                messages: {
                    SceneryName: "*必填项"
                }
            });
        })

    </script>
    <style type="text/css">
        #SceneryName, #WebSiteUrl, #Keyword
        {
            width: 800px;
        }
    </style>
</head>
<body>
    @using (Html.BeginForm())
    {
        <div id="container">
            <div class="navTitle">
                编辑景点</div>
            @Html.OutputMessage(Model.Message)
            <div id="tabs">
                <ul>
                    <li><a href="#tabs-1">基本资料</a></li>
                    @if (Model.SceneryID != 0)
                    {
                        <li><a href="#tabs-2">相册</a></li>
                        <li><a href="#tabs-3">地图</a></li>
                    }
                </ul>
                <div id="tabs-1" class="editForm">
                    <input name="SceneryID" type="hidden" value="@Model.SceneryID" />
                    <table style="table-layout: fixed; width: 100%;">
                        <tr>
                            <td style="width: 100px;">
                                <strong>景点名称：</strong>
                            </td>
                            <td>@Html.TextBoxFor(t => t.SceneryName)
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <strong>景点级别：</strong>
                            </td>
                            <td>@Html.DropDownListFor(t => t.Level, PageHelper.SceneryLevelSelector(Model.Level))
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <strong>推荐描述：</strong>
                            </td>
                            <td>@Html.TextBoxFor(t => t.RecommendDspt, new { style = "width:801px" })
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <strong>游玩主题：</strong>
                            </td>
                            <td>@Html.DropDownListFor(t => t.SceneryPlaytheme, PageHelper.SceneryPlaythemeSelector(Model.SceneryPlaytheme))
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <strong>景点位置：</strong>
                            </td>
                            <td>
                                @Html.DropDownList("ProvinceID", PageHelper.ProvinceSelector(Model.ProvinceID))
                                @Html.DropDownList("CityID", PageHelper.CitySelector(Model.CityID, Model.ProvinceID))
                                @Html.DropDownList("AreaID", PageHelper.AreaSelector(Model.AreaID, Model.CityID))
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <strong>景点网址：</strong>
                            </td>
                            <td>
                                @Html.TextBoxFor(t => t.WebSiteUrl)
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <strong>景点地址：</strong>
                            </td>
                            <td>
                                @Html.TextBoxFor(t => t.Address, new { style = "width:800px" })
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <strong>景区介绍：</strong>
                            </td>
                            <td>
                                @Html.TextAreaFor(t => t.Intro, new { style = "width:800px;" })
                            </td>
                        </tr>
                        @for (int i = 0; i < Model.IntroList.Count; i++)
                        {
                            SceneryIntro intro = Model.IntroList[i];
                            <tr>
                                <td>
                                    <strong>
                                        @PageHelper.SceneryIntroCategoryIDToStr(intro.Category)：
                                        @Html.Hidden("IntroCategorys", intro.Category)</strong>
                                </td>
                                <td>
                                    <textarea name="InfoContents" id="InfoContents@(i)" cols="20" rows="2" style="width:800px;" class="InfoContents">@intro.Content</textarea>
                                </td>
                            </tr>
                        
                        }
                        <tr>
                            <td>
                            </td>
                            <td>
                            </td>
                        </tr>
                    </table>
                    <div>
                    </div>
                    <div class="toolBar_bottom">
                        <input id="Submit1" class="large_button" type="submit" value="保存" />
                        <a href="javascript:void(0)" onclick="parent.closeCurrentTab()">返回</a>
                    </div>
                </div>
                @if (Model.SceneryID != 0)
                {
                    <div id="tabs-2">
                        <!-- 相册 -->
                        <iframe src="/Scenery/PhotoManage?SceneryID=@Model.SceneryID" scrolling="no" frameborder="0" width="100%" height="700px">
                        </iframe>
                    </div>
                    <div id="tabs-3">
                        <!-- 地图 -->
                        <iframe src="/Scenery/Map?SceneryID=@Model.SceneryID" frameborder="0" width="100%" height="700px">
                        </iframe>
                    </div>
                }
            </div>
        </div>
    }
</body>
</html>
